<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
   
    
    // [1, 3, 5].forEach(item => {
    //   console.log('遍历的回调', item)
    // })
    // console.log('forEach之后')

    // new Promise(() => {
    //   console.log('excutor回调')
    // })
    // console.log('new Promise之后')

    
    // setTimeout(() => {
    //   console.log('定义时器的回调')
    // }, 0);
    // console.log('启动定时器之后')

    /* Promise.resolve().then(value => {
      console.log('成功的回调')
    })
    console.log('then()之后') */

    new Promise((resolve) => {
      // resolve(1)  
      // console.log('resolve之后')

      setTimeout(() => {
        resolve(1)  
        console.log('resolve之后')
      }, 1000);
    }).then(value => {
      console.log('成功的回调', value)
    })
    console.log('.then之后')

  </script>
</body>
</html>